$(function () {
    $("#getVerifyCode").on("click",function (event) {
        //获取手机号，传到后台，然后发送验证码短信
        var mobilePhone  = $("#mobilePhone").val();
        $.ajax({
            url: "/account/sendVerifyCode/"+mobilePhone,
            success:function (datas) {
                alert("验证码已发送，请查收");
                $("#getVerifyCode").attr('disabled',true);
                $("#getVerifyCode").removeClass("btn-success").addClass("disabled")
            }
        })
    })

    $("#submitLogin").on('click',function (event) {
        var mobilePhone = $("#mobilePhone").val();
        var verifyCode  = $("#verifyCode").val();
        $.ajax({
            url:"/account/submitLogin?mobilePhone="+mobilePhone+"&verifyCode="+verifyCode,
            success:function (datas) {
                window.location.href=datas;
            }
        })
    })

})